package com.itheima.TestInner;

public class TestMain {
    public static void main(String[] args) {
        SwimmingImpl swimmingImpl = new SwimmingImpl();
        goSwimming(swimmingImpl);

        goSwimming(new Swimming() {
            @Override
            public void swim() {
                System.out.println("仰泳");
            }
        });

        TestMain.goSwimming(() -> System.out.println("大大大大大大"));
    }

    //定义去游泳的方法：
    public static void goSwimming(Swimming swimming){
        swimming.swim();
    }
}

class SwimmingImpl implements Swimming{

    @Override
    public void swim() {
        System.out.println("蛙泳");
    }
}
